function [ ] = plotConvergence( HAxis, errors, legends, formats )
%PLOTCONVERGENCE 

figure;
loglog([0.01 0.1],[0.0001 0.01], '-k ','LineWidth',2,'MarkerSize',10); hold on;
for c = 1 : size(errors,2);
    error = errors( : , c);
    loglog(HAxis, error, formats(c,:), 'LineWidth',2,'MarkerSize',10); hold on;
end;
legends = char('Reference ', legends);
legend(legends);

hold off;

end

%legends = char('$p=10^3$','$p=\frac{10^3}{8 h}$','$p=\frac{10^3}{64 h^2}$','$p=\frac{8\times 10^4}{8h}$','$p=\frac{10^4}{h}$','$p=\frac{10^4}{8 h^2}$', '$p=10^6$', '$p=10^7$');
%formats = char('-ko','-ks','-kv','--ko','--ks','--kv', '-.ko', '-.ks');
